<?php
include("mysqlcon.php");
include("ok.php");
include("error.php");
include("userid.php");

$cid=$_GET["id"];
$customer_id = $_POST[customer_id];
$customer_name = $_POST[customer_name];
$customer_surname = $_POST[customer_surname];
$customer_address = $_POST[customer_address];
$customer_email = $_POST[customer_email];
$customer_tel = $_POST[customer_tel];
$customer_fax = $_POST[customer_fax];

	if($error==false){
      mysql_select_db($dbname,$conn);
      mysql_query('SET NAMES utf8');
	
			$update_customer = "UPDATE `customer` SET `customer_id` = '$customer_id',`customer_name` = '$customer_name',`customer_surname` = '$customer_surname',`customer_address` = '$customer_address',`customer_email` = '$customer_email',`customer_tel` = '$customer_tel',`customer_fax` = '$customer_fax' WHERE `id` = $cid LIMIT 1";
	echo $update_user;
      if(!mysql_query($update_customer,$conn))
				   error_page("ฐานข้อมูลผิดพลาด $strSQL");
				else 
				{
				   $ok_text = "";
				   ok_page("แก้ไขข้อมูลลูกค้าเรียบร้อย","ระบบทำการจัดเก็บข้อมูลผู้ใช้เรียบร้อยแล้ว",$ok_text,"listCustomer.php","");
				   mysql_close($conn);
				}
	}
?>